package com.southsmart.sgeocserver.exception;


import com.southsmart.sgeocserver.api.IErrorCode;

/**
 *@author cjunxian
 *@date 2020/09/22  14:54:20
 *@doc 断言处理类，用于抛出各种API异常
 *@version 1.0.0
 */
public class Asserts {

    public static void fail(String message) {
        throw new ApiException(message);
    }

    public static void fail(IErrorCode errorCode) {
        throw new ApiException(errorCode);
    }

    public static void isNull(Object obj,String message){
        if(obj == null){
            throw new ApiException(message);
        }
    }
}
